#define _CRT_SECURE_NO_DEPRECATE 1

#pragma warning(disable:4996)

#include "stack.h"
#include "queue.h"

void TestQueue1()
{
	Queue q;
	QueueInit(&q);
	QueuePush(&q, 1);
	QueuePush(&q, 2);
	QueuePush(&q, 3);
	QueuePop(&q);
	QueuePop(&q);
	QueuePop(&q);
}

void TestQueue2()
{
	Queue q;
	QueueInit(&q);
	QueuePush(&q, 1);
	QueuePush(&q, 2);
	QueuePush(&q, 3);
	QueuePush(&q, 4);
	while (!QueueEmpty(&q))
	{
		QDataType front = QueueFront(&q);
		printf("%d ", front);
		QueuePop(&q);
	}
	printf("\n");
}

void TestStack1()
{
	ST st;
	StackInit(&st);
	StackPush(&st, 1);
	StackPush(&st, 2);
	StackPush(&st, 3);
	StackPush(&st, 4);
	StackPop(&st);
	StackPop(&st);
	StackPop(&st);
	StackPop(&st);
	//StackPop(&st);
	StackDestory(&st);
}

void TestStack2()
{
	ST st;
	StackInit(&st);
	StackPush(&st, 1);
	StackPush(&st, 2);
	StackPush(&st, 3);
	StackPush(&st, 4);
	while (!StackEmpty(&st))
	{
		printf("%d ", StackTop(&st));
		StackPop(&st);
	}
	//StackDestory(&st);
}

TestStack3()
{
	ST st;
	StackInit(&st);
	StackPush(&st, 4);
	StackPush(&st, 5);
	StackPush(&st, 6);
	int size = StackSize(&st);
	printf("%d\n", size);
	StackDestory(&st);
}

int main()
{
	//TestStack1();
	//TestStack2();
	TestStack3();
	//TestQueue1();
	//TestQueue2();
	return 0;
}

//int main()
//{
//	int x, y;
//	scanf("%d %d", &x, &y);
//	x = x ^ y;
//	y = y ^ x;
//	x = x ^ y;
//	printf("%d %d", x, y);
//	return 0;
//}
